public class CaseListController {
    public CaseListController(ApexPages.StandardSetController controller) {

    }

    Public String caseId {get;set;}

    public List<Case> results {
        get{
            if(results == null) results = new List<Case>();
            return results;
        }
        set;    
    }
   
    public ApexPages.standardcontroller Controller {get;set;}
    
    public Case c { get; set; }
    
    public CaseListController(ApexPages.StandardController stdController) {
        // constructor
        Controller = stdController;
        this.c = (Case)stdController.getRecord();
    }
    
    public String searchText {
        get;
        set{
                value = value.endsWith('*') ? value : value + '*';
            searchText = value;
        }
    }
    // TODO: Create a Boolean property called "showSearch" that returns a true value instead of null
    public Boolean showSearch {
        get{
            if (showSearch == null) showSearch = true;
            return showSearch;
        }
        set;
    }
     
    public PageReference doSearch() {
        results = (List<Case>)[FIND :searchText IN ALL FIELDS RETURNING Case(Id, CaseNumber, Subject, CreatedById, Priority, Status, Contact.Name, Account.Name, CreatedDate)] [0];
        return null;
    }
        
    public PageReference selectCase() {
        Case c = [Select Id, CaseNumber, Subject, CreatedById, Priority, Status, Contact.Name, Account.Name, CreatedDate from Case where Id =:caseId];
        Controller = new ApexPages.standardController(c);
        return Controller.view();
    }
}